<template>
  <div class="live_container">
    <a href="javascript:;">
      <div class="live_wrapper">
        <div class="img_area">
          <div class="status">直播中</div>
          <img src="/static/video/live_bg.webp" alt="封面" />
        </div>
        <div class="text_area">
          <div class="title tc_black fs_16">
            {{ liveMsg.title }}
          </div>
          <div class="bottom_text tc_slate fs_12">
            <div class="section d_i_block">
              {{ liveMsg.type }}
            </div>
            <div class="view_num d_i_block">
              &nbsp;·&nbsp;{{ liveMsg.viewNum }}人气
            </div>
          </div>
        </div>
      </div>
    </a>
  </div>
</template>

<script>
export default {
  props: {
    liveMsg: {
      typeof: Object,
      required: true,
    },
  },
};
</script>

<style lang="scss">
* {
  margin: 0;
  padding: 0;
  list-style: none;
}
a {
  text-decoration: none;
  outline: none;
}
.tc_black {
  color: #222;
}
.tc_slate {
  color: #99a2aa;
}
.fs_12 {
  font-size: 12px;
}
.fs_16 {
  font-size: 16px;
}
.d_i_block {
  display: inline-block;
}
.live_container {
  height: 127px;
  width: 520px;
  background-color: #fff;
  border: 1px solid #e5e9ef;
  border-radius: 4px;
  overflow: hidden;
  position: relative;
  z-index: 1;
  text-align: left;
  .img_area {
    position: relative;
    width: 203px;
    height: 127px;
    display: inline-block;
    vertical-align: top;
    img {
      width: 100%;
      height: 100%;
      border: 0 4px 4px 0;
    }
  }
  .status {
    letter-spacing: 0.2px;
    color: #fff;
    background-color: #fb7299;
    font-size: 12px;
    padding: 0 4px;
    height: 18px;
    line-height: 18px;
    border-radius: 2px;
    position: absolute;
    right: 8px;
    top: 8px;
    text-align: center;
    z-index: 3;
  }
  .text_area {
    width: 285px;
    height: 100%;
    margin: 12px 16px;
    display: inline-block;
    vertical-align: top;
    .title {
      width: 100%;
      height: 52px;
      margin-bottom: 30px;
      overflow: hidden;
      text-overflow: ellipsis;
      word-break: break-all;
      display: -webkit-box;
      -webkit-line-clamp: 2;
      -webkit-box-orient: vertical;
      font-size: 16px;
      line-height: 16px;
      max-height: 3.25em;
    }
    .view_num {
      width: 130px;
    }
  }
}
</style>